package paper.xml;

import javax.xml.parsers.*;
import org.xml.sax.helpers.*;
import org.xml.sax .*;
import java.io.*;
import org.xml.sax.helpers.DefaultHandler;
import java.util.*;

import paper.xml.SurroundStream;
import paper.xml.CiteseerParser;
import paper.xml.DblpParser;
import paper.xml.PaperSet;

class HashPaperBase {

    public static void main(String[] arse) throws ParserConfigurationException,SAXException,IOException
    {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        SAXParser parser = factory.newSAXParser();

        PaperSetHash set = new PaperSetHash();
        try {
            File baseDir = new File("../raw-sources/");
            File cite = new File(baseDir,"WHOLETHING");
            File dblp = new File(baseDir,"dblp.xml");
            parser.parse( new BufferedInputStream( new FileInputStream(dblp)), new DblpParser(set));
            parser.parse( new SurroundStream(cite), new CiteseerParser(set));
            set.dumpHash();

        } catch (SAXParseException se)
        {
            System.out.println("Error: " + se.toString() + " at line " + se.getLineNumber());
        } 
    }
}
